// import { getAllRoleList, isAccountExist } from '@/api/demo/system';
import { BasicColumn, FormSchema } from '@/components/Table';
import { useI18n } from "@/hooks/web/useI18n";

const { t } = useI18n();
/**
 * transform mock data
 * {
 *  0: '华东分部',
 * '0-0': '华东分部-研发部'
 * '0-1': '华东分部-市场部',
 *  ...
 * }
 */
// export const deptMap = (() => {
//   const pDept = ['华东分部', '华南分部', '西北分部'];
//   const cDept = ['研发部', '市场部', '商务部', '财务部'];

//   return pDept.reduce((map, p, pIdx) => {
//     map[pIdx] = p;

//     cDept.forEach((c, cIndex) => (map[`${pIdx}-${cIndex}`] = `${p}-${c}`));

//     return map;
//   }, {});
// })();
//表头数据
export const columns: BasicColumn[] = [
  {
    title: t('sys.informaionMatchaing.columns.type'),
    dataIndex: 'type',
    width: 120,
  },
  {
    title: t('sys.informaionMatchaing.columns.createUsername'),
    dataIndex: 'name',
    width: 120,
  },
  {
    title: '操作时间',
    dataIndex: 'createTime',
    width: 120,
  },
];
//表头搜素数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'id',
    label: t('sys.informaionMatchaing.columns.createUsername'),
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'nickname',
    label: t('sys.device.columns.time'),
    component: 'Input',
    colProps: { span: 4 },
  },
];

export const accountFormSchema: FormSchema[] = [
  {
    field: 'type',
    component: 'Input',
    label: t('sys.informaionMatchaing.columns.type'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    rules: [{ required: true }],
  },
  {
    field: 'name',
    component: 'Input',
    label: t('sys.informaionMatchaing.columns.createUsername'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    rules: [{ required: true }],
  },
];
